<template>
  <div class="map-info">
    <div class="mapBox">
      <div style="width: 100%; height: 100%">
        <div
          class="pointContent"
          v-for="item in pointList"
          :key="item.id"
          :style="item.style"
          @click="selectLocationIdFun(item)"
        >
          <point-offline
            :select="item.id == deviceId ? true : false"
            v-if="item.state == 'OFFLINE'"
          ></point-offline>
          <point-err
            :select="item.id == deviceId ? true : false"
            v-if="item.state != 'OFFLINE'&&item.alert"
          ></point-err>
          <point-no-err
            :select="item.id == deviceId ? true : false"
            v-if="item.state != 'OFFLINE'&&!item.alert"
          ></point-no-err>

          <div :class="item.state == 'OFFLINE' ? 'offline' :item.alert == false ?'noerr':'err'" class="locationName_cur" ref="TheStyle" v-show="item.id == deviceId ? true : false">
            <div>{{ item.code }}</div>
          </div>
          <div :class="item.state == 'OFFLINE' ? 'offline' :item.alert == false ?'noerr':'err'" class="locationName" ref="TheStyle" v-show="item.id != deviceId ? true : false">
            <div>{{ item.code }}</div>
          </div>
        </div>
      </div>
      <!-- <img src="@/assets/images/mapImg/airport/B1.png" style="width: 100%" /> -->
      <img :src="require(`@/assets/images/mapImg/airport/${selectFloor}.png`)" style="width: 80%" />
    </div>
  </div>
</template>

<script>
import pointErr from "./pointErr";
import pointNoErr from "./pointNoErr";
import pointOffline from "./pointOffline";
// import { locationAlertStatus } from "@/api/index";
// import store from "@/store";
// import { hospitalMapPoint } from "@/utils/globalData";
export default {
  props: {
    msg: String,
    deviceId: String,
    allDeviceData: Array,
    pointList:Array,
    selectFloor:String
  },
  components: {
    pointErr,
    pointNoErr,
    pointOffline
  },
  watch: {

  },
  mounted() {
  },
  data() {
    return {
    };
  },
  methods: {
    selectLocationIdFun(item) {
      this.$emit("selectLocationIdFun", item);
    }
  }
};
</script>

<style scoped>
</style>
